package com.coffeeloversupportlibrary.coffeelover.domain;

import android.app.Activity;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;

import com.coffeeloversupportlibrary.coffeelover.domain.article.ArticleFragment;
import com.coffeeloversupportlibrary.coffeelover.domain.coffeebean.BeansFragment;
import com.coffeeloversupportlibrary.coffeelover.domain.dailyshare.DailyShareFragment;
import com.coffeeloversupportlibrary.coffeelover.domain.mine.MineFragment;
import com.coffeeloversupportlibrary.coffeelover.mercury.main.CategoryFragment;
import com.coffeeloversupportlibrary.coffeelover.mercury.my.CenterFragment;
import com.coffeeloversupportlibrary.core.base.BaseViewModel;

import java.util.ArrayList;
import java.util.List;

/**
 * @author puyv
 * @createTime 2021/11/8 9:47
 * @projectName CoffeeLoverSupportLibrary
 * @className MainViewModel.java
 * @description TODO
 */
public class MainViewModel extends BaseViewModel {
    /**
    * @date 2021/11/22 13:36
    * @params []
    * @return void
    * @description TODO 主页面 ViewModel 不需要 Model 层数据服务
    */
    @Override
    protected void setModel() {}
    // TODO: 2021/11/22 ViewModel 为主界面准备数据 ,方法暴露给UI层
    public  FragmentContainerAdapter initFragment(FragmentManager fragmentManager, Activity activity){
        List<String> titles=new ArrayList<>();
        String article="article";
        String beans="beans";
        String map="map";
        String mine="mine";
        titles.add(article);
        titles.add(beans);
        titles.add(map);
        titles.add(mine);

        ArticleFragment articleFragment=new ArticleFragment();

        CategoryFragment categoryFragment=new CategoryFragment(activity);

        DailyShareFragment dailyShareFragment=new DailyShareFragment();

        CenterFragment centerFragment=new CenterFragment(activity);


        List<Fragment> fragments=new ArrayList<Fragment>();
        fragments.add(articleFragment);
        fragments.add(categoryFragment);
        fragments.add(dailyShareFragment);
        fragments.add(centerFragment);
       return new FragmentContainerAdapter(fragmentManager,fragments,titles);

    }
}
